/********************************************************************************
*
* Analysis Online Appendix
*
********************************************************************************/

set more off

* set local path to the replication package here:
global path_package "../_replication_package/"
cd "$path_package"

* set path to individual level SAKE data (see Other data/README.txt)
global path_individual_data ""



/************************************************************************
*
* Study 1
*
************************************************************************/

local path "$path_package/Study 1"

cd "`path'/"


*** Table A2

use "`path'/Data_Individual.dta", clear
tabu lying_aversion if nr_lies==0
tabu lying_aversion if nr_lies==1
tabu lying_aversion if nr_lies==2
tabu lying_aversion if nr_lies==3
tabu lying_aversion if nr_lies==4
tabu lying_aversion if nr_lies==5
tabu lying_aversion if nr_lies==.

table lying_aversion, c(mean expprofit_lying)

*** Table A3

use Data_Market_Microlevel.dta, clear

replace nr_lies=10 if nr_lies==.
gen immoral = 1-moral

* columns (1) to (4)
reg hired1 i.nr_lies if immoral, cluster(sessiongroup)
reg hired1 expprofit_lying if immoral, cluster(sessiongroup)
reg hired1 i.nr_lies if moral, cluster(sessiongroup)
reg hired1 expprofit_lying if moral, cluster(sessiongroup)

*** Figure A2

use Data_Market_Microlevel.dta, clear
preserve
collapse (mean) hired1, by(low_theta period moral)
line hired1 period if low_theta & !moral, lpattern(shortdash) lwidth(thick) || line hired1 period if !low_theta & !moral, lwidth(thick) ||, legend(label(1 "Low-theta") label(2 "High-theta")) xlabel(1 5 10 15) ylabel(0(.1)1) ytitle("Employment rate") plotregion(fcolor(white)) graphregion(fcolor(white))
line hired1 period if low_theta & moral, lpattern(shortdash) lwidth(thick) || line hired1 period if !low_theta & moral, lwidth(thick) ||,  legend(label(1 "Low-theta") label(2 "High-theta")) xlabel(1 5 10 15) ylabel(0(.1)1) ytitle("Employment rate") plotregion(fcolor(white)) graphregion(fcolor(white))
restore

*** Figure A3

use "Data_Market_Macrolevel.dta", replace
gen immoral = 1 - moral
bysort moral period: egen av_q = mean(equq)
line av_q period if moral==0, c(ascending) lpattern(shortdash) lwidth(thick) || line av_q period if moral==1, c(ascending) lwidth(thick) || function y=6, range(1 15) lpattern(longdash) lwidth(thick) ||, legend(label(1 "Immoral work") label(2 "Neutral work") label(3 "Equilibrium prediction")) ylabel(0(1)6) xlabel(1(1)15) ytitle("Average market quantity") xtitle("Period") plotregion(fcolor(white)) graphregion(fcolor(white))
* table notes:
reg equq immoral, cluster(sessiongr)

*** Table A4

use Data_Market_Microlevel.dta, clear
gen immoral = 1 - moral
gen participate = 1 - not_participate
replace wagerequest=50 if wagerequest==.
replace wagerequest2=50 if wagerequest2==. 
gen neutral_low_theta = moral * low_theta
gen period_lowtheta = period*low_theta
probit participate low_theta period period_lowtheta if immoral, cluster(sessiongr)
test period + period_lowtheta==0
truncreg wagerequest low_theta period period_lowtheta if immoral, ul(50) cluster(sessiongr)
test period + period_lowtheta==0
truncreg wagerequest low_theta period period_lowtheta if moral, ul(50) cluster(sessiongr)
test period + period_lowtheta==0

*** Table A5

probit participate low_theta age swiss female if immoral, cluster(sessiongr)
truncreg wagerequest low_theta moral neutral_low_theta age swiss female, ul(50) cluster(sessiongr)
test low_theta + neutral_low_theta==0
reg hired1 low_theta moral neutral_low_theta age swiss female, cluster(sessiongroup)
test low_theta + neutral_low_theta==0
reg hired1 low_theta moral neutral_low_theta age swiss female i.sessiongroup, cluster(sessiongroup)
test low_theta + neutral_low_theta==0
gen hired_tot = hired1 + hired2
reg hired_tot low_theta moral neutral_low_theta age swiss female, cluster(sessiongroup)
test low_theta + neutral_low_theta==0
reg hired_tot low_theta moral neutral_low_theta age swiss female i.sessiongroup, cluster(sessiongroup)
test low_theta + neutral_low_theta==0

*** willginess to work

* Table A10
insheet using "$path_package/Other data/Perception_data/Sample1/I_company.csv", clear
list description_comp company

use "Data_WTW.dta", clear
** drop observation of people that did not fill out the survey (we do not have WTW for them)
drop if age==.
gen high_theta = 1 - low_theta
gen lowt_ij = high_theta * i_j_s1
// missings
gen missing = (WTW==.)

*** Table A11
ivreg2 WTW i_j_s1 high_theta lowt_ij if industry_ds==1, cluster(sessionsubject NOGA084)
ivreg2 WTW i_j_s1 high_theta lowt_ij i.major_cat female age swiss grosswage_rhrl revenue_per_employee tot_employ if industry_ds==1, cluster(sessionsubject NOGA084) partial(i.major_cat)
ivreg2 WTW i_j_s1 high_theta lowt_ij if industry_ds==0, cluster(sessionsubject description_comp)
ivreg2 WTW i_j_s1 high_theta lowt_ij i.major_cat female age swiss if industry_ds==0, cluster(sessionsubject description_comp) partial(i.major_cat)

*** Table A12
gen lowt_ij_alt = high_theta * i_j_s1_alt
ivreg2 WTW i_j_s1_alt high_theta lowt_ij_alt if industry_ds==0, cluster(sessionsubject description_comp)
ivreg2 WTW i_j_s1_alt high_theta lowt_ij_alt i.major_cat female age swiss if industry_ds==0, cluster(sessionsubject description_comp) partial(i.major_cat)

*** Table A13
preserve
replace WTW = .5 if WTW==. 
ivreg2 WTW i_j_s1 high_theta lowt_ij if industry_ds==0, cluster(sessionsubject description_comp)
ivreg2 WTW i_j_s1 high_theta lowt_ij i.major_cat female age swiss if industry_ds==0, cluster(sessionsubject description_comp) partial(i.major_cat)
restore
preserve
keep if industry_ds==0
bysort sessionsubject: egen nrmissing = sum(missing)
keep if nrmissing==0
ivreg2 WTW i_j_s1 high_theta lowt_ij if industry_ds==0, cluster(sessionsubject description_comp)
ivreg2 WTW i_j_s1 high_theta lowt_ij i.major_cat female age swiss if industry_ds==0, cluster(sessionsubject description_comp) partial(i.major_cat)
restore

*** Table A14
preserve
replace lowt_ij = hired1 * i_j_s1
ivreg2 WTW i_j_s1 hired1 lowt_ij if industry_ds==1 & !moral, cluster(sessionsubject NOGA084)
ivreg2 WTW i_j_s1 hired1 lowt_ij i.major_cat female age swiss grosswage_rhrl revenue_per_employee tot_employ if industry_ds==1  & !moral, cluster(sessionsubject NOGA084) partial(i.major_cat)
ivreg2 WTW i_j_s1 hired1 lowt_ij if industry_ds==0  & !moral, cluster(sessionsubject description_comp)
ivreg2 WTW i_j_s1 hired1 lowt_ij i.major_cat female age swiss if industry_ds==0  & !moral, cluster(sessionsubject description_comp) partial(i.major_cat)
restore 
*** Appendix F

use "`path'/Data_Individual.dta", clear

*** Table F1
sum PV1_index PV2_index situation1 situation2 hexaco_sincerity hexaco_fairness hexaco_greedavoid hexaco_modesty charityattindex

*** Table F2
gen high_theta = 1 - low_theta
foreach var in PV1_index PV2_index situation1 situation2 hexaco_sincerity hexaco_fairness hexaco_greedavoid hexaco_modesty charityattindex {
reg high_theta `var', robust
}

*** Figure F1
kdensity factor1, xtitle(Theta survey) plotregion(fcolor(white)) graphregion(fcolor(white)) title("")

*** Section F.3
reg high_theta factor1, rob
corr high_theta factor1
spearman high_theta factor1
corr nr_lies factor1
spearman nr_lies factor1
corr expprofit_lying factor1
spearman expprofit_lying factor1

use Data_Market_Microlevel.dta, clear
gen immoral = 1 - moral
gen participate = 1 - not_participate

*** Table F3
gen neutral_low_theta = moral * factor1
reg hired1 factor1 moral neutral_low_theta, cluster(sessiongroup)
test factor1 + neutral_low_theta==0
replace neutral_low_theta = moral * factor1_rob1
reg hired1 factor1_rob1 moral neutral_low_theta, cluster(sessiongroup)
test factor1_rob1 + neutral_low_theta==0
replace neutral_low_theta = moral * factor1_rob2
reg hired1 factor1_rob2 moral neutral_low_theta, cluster(sessiongroup)
test factor1_rob2 + neutral_low_theta==0


** Table F4
replace wagerequest=50 if wagerequest==.
replace wagerequest2=50 if wagerequest2==. 
probit participate factor1 if immoral, cluster(sessiongr)
truncreg wagerequest factor1 if immoral, ul(50) cluster(sessiongr)
probit participate factor1_rob1 if immoral, cluster(sessiongr)
truncreg wagerequest factor1_rob1 if immoral, ul(50) cluster(sessiongr)
probit participate factor1_rob2 if immoral, cluster(sessiongr)
truncreg wagerequest factor1_rob2 if immoral, ul(50) cluster(sessiongr)

** Figure F2
* Supply Low-theta survey
use Data_Market_Microlevel.dta, clear
drop if moral
gen surv_low_theta = (factor1<0.5)
drop if surv_low_theta
tempfile temp_data
forvalues i=1(1)1000 {
preserve
set seed `i'
gen rand = uniform()
sort rand
keep if _n<=6
gen subjectnr = _n
keep subjectnr wagerequest wagerequest2
rename wagerequest wagerequest1
reshape long wagerequest, i(subjectnr) j(j)
drop j subjectnr
replace wagerequest=50 if wagerequest==.
gsort +wagerequest
gen rank=_n
if(`i'>1) {
append using `temp_data'
}
save `temp_data', replace
restore
}
use `temp_data', clear
bysort rank: egen mean_wagerequest = mean(wagerequest)
table rank, c(mean mean_wagerequest)

* Supply high-theta survey
use Data_Market_Microlevel.dta, clear
drop if moral
gen surv_low_theta = (factor1<0.5)
drop if !surv_low_theta
tempfile temp_data
forvalues i=1(1)1000 {
preserve
set seed `i'
gen rand = uniform()
sort rand
keep if _n<=6
gen subjectnr = _n
keep subjectnr wagerequest wagerequest2
rename wagerequest wagerequest1
reshape long wagerequest, i(subjectnr) j(j)
drop j subjectnr
replace wagerequest=50 if wagerequest==.
gsort +wagerequest
gen rank=_n
if(`i'>1) {
append using `temp_data'
}
save `temp_data', replace
restore
}
use `temp_data', clear
bysort rank: egen mean_wagerequest = mean(wagerequest)
table rank, c(mean mean_wagerequest)

*** Figure F3

* F3a
use "Data_WTW.dta", clear
drop if age==.

mat estimates = J(20,3,.)

local j = 1

foreach industry in 1083 1200 1712 2540 2611 4120 4520 4635 4642 4645 4648 5510 5610 6419 6492 6512 8411 9200 9311 9313 {

reg WTW factor1 if NOGA084 ==`industry', robust
scalar beta = _b[factor1]
matrix estimates[`j',1] = beta

sum i_j_s1 if NOGA084 ==`industry'
scalar i_j = r(mean)
matrix estimates[`j',2] = i_j

matrix estimates[`j',3] = `industry'

local j = `j' + 1

}

clear
svmat estimates
rename estimates1 beta
rename estimates2 i_j
rename estimates3 NOGA084

gen dependentvar=""
replace dependentvar = "Monetary intermediations" if NOGA084 == 6419
replace dependentvar = "Gambling and betting" if NOGA084==9200
replace dependentvar = "Non-life insur." if NOGA084==6512
replace dependentvar = "Tobacco (manuf.)" if NOGA084==1200
replace dependentvar = "Perfumes (wholes.)" if NOGA084==4645
replace dependentvar = "Paper (manuf.)" if NOGA084==1712
replace dependentvar = "Tobacco (wholes.)" if NOGA084==4635
replace dependentvar = "Electronic (manuf.)" if NOGA084==2611
replace dependentvar = "Weapons (manuf.)" if NOGA084==2540
replace dependentvar = "Maintenance vehicles" if NOGA084==4520
replace dependentvar = "Hotels and accomodation" if NOGA084==5510
replace dependentvar = "Construction" if NOGA084==4120
replace dependentvar = "Public administration" if NOGA084==8411
replace dependentvar = "Restaurant activities" if NOGA084==5610
replace dependentvar = "Sports facilities" if NOGA084==9311
replace dependentvar = "Credit granting" if NOGA084==6492
replace dependentvar = "Tea and coffee" if NOGA084==1083
replace dependentvar = "Clothing and footwear" if NOGA084==4642
replace dependentvar = "Watches and jewelry" if NOGA084==4648
replace dependentvar = "Fitness facilities" if NOGA084==9313

gen position_ind_highth = 3
replace position_ind_highth = 9 if dependentvar == "Hotels and accomodation" | dependentvar == "Watches and jewelry" | dependentvar == "Public administration" | dependentvar == "Weapons (manuf.)" 
replace position_ind_highth = 6 if dependentvar == "Monetary intermediations" | dependentvar == "Clothing and footwear"
replace position_ind_highth = 12 if dependentvar == "Tea and coffee" | dependentvar == "Fitness facilities"
twoway (scatter beta i_j, msize(small) mlabel(dependentvar) mlabv(position_ind_highth) mlabsize(small) mcolor(black) mlabcolor(black)) (lfit beta i_j, color(gs6) lpattern(dash)), xlabels(-1(1)1) ylabels(-0.6(0.2)0.6) xtitle("Perceived immorality I(j)") ytitle("Differences in willingness to work") plotregion(fcolor(white)) graphregion(fcolor(white)) legend(off)

* F3b
use "Data_WTW.dta", clear
drop if age==.
mat estimates = J(26,3,.)
local j = 1

foreach company in abb adecco creditsuisse ernstyoung firmenich glencore holcim marlboro migros monsanto nestle novartis phillipemorris projuventute pronatura redcross roche swatch swisscom swisslife syngenta tamoil ubs unicef winterthurass wwf {

reg WTW factor1 if description_comp =="`company'", robust
scalar beta = _b[factor1]
matrix estimates[`j',1] = beta

sum i_j_s1 if description_comp =="`company'"
scalar i_j = r(mean)
matrix estimates[`j',2] = i_j

matrix estimates[`j',3] = `j'

local j = `j' + 1

}
clear

svmat estimates
rename estimates1 beta
rename estimates2 i_j
rename estimates3 company

gen company_name = ""

local j = 1
foreach company in abb adecco creditsuisse ernstyoung firmenich glencore holcim marlboro migros monsanto nestle novartis phillipemorris projuventute pronatura redcross roche swatch swisscom swisslife syngenta tamoil ubs unicef winterthurass wwf {
replace company_name = "`company'" if company==`j'
local j = `j' + 1
}

gen dependentvar = ""
replace dependentvar = "Glencore" if company_name=="glencore"
replace dependentvar = "Novartis" if company_name=="novartis"
replace dependentvar = "Roche" if company_name=="roche"
replace dependentvar = "ABB" if company_name=="abb"
replace dependentvar = "UNICEF" if company_name=="unicef"
replace dependentvar = "Adecco" if company_name=="adecco"
replace dependentvar = "Migros" if company_name=="migros"
replace dependentvar = "Holcim" if company_name=="holcim"
replace dependentvar = "Pro Juventute" if company_name=="projuventute"
replace dependentvar = "Credit Suisse" if company_name=="creditsuisse"
replace dependentvar = "Swisscom" if company_name=="swisscom"
replace dependentvar = "Swatch" if company_name=="swatch"
replace dependentvar = "UBS" if company_name=="ubs"
replace dependentvar = "Red Cross" if company_name=="redcross"
replace dependentvar = "Malboro" if company_name=="marlboro"
replace dependentvar = "Monsanto" if company_name=="monsanto"
replace dependentvar = "Nestle" if company_name=="nestle"
replace dependentvar = "WWF" if company_name=="wwf"
replace dependentvar = "Tamoil" if company_name=="tamoil"
replace dependentvar = "Ernst and Young" if company_name=="ernstyoung"
replace dependentvar = "Pro Natura" if company_name=="pronatura"
replace dependentvar = "Winterthur Assurances" if company_name=="winterthurass"
replace dependentvar = "Syngenta" if company_name=="syngenta"
replace dependentvar = "Firmenich" if company_name=="firmenich"
replace dependentvar = "Philip Morris" if company_name=="phillipemorris"
replace dependentvar = "Swiss life" if company_name=="swisslife"

gen position_firm_highth = 3
replace position_firm_highth = 9 if dependentvar == "Swisscom"|dependentvar == "Swiss life"| dependentvar == "Syngenta"| dependentvar == "UNICEF" |dependentvar == "Holcim" | dependentvar == "ABB"| dependentvar == "Tamoil"|dependentvar == "Swatch"| dependentvar == "Roche"
replace position_firm_highth = 12 if  dependentvar == "Ernst and Young"| dependentvar == "Credit Suisse"
twoway (scatter beta i_j, msize(small) mlabel(dependentvar) mlabv(position_firm_highth) mlabsize(small) mcolor(black) mlabcolor(black)) (lfit beta i_j, color(gs6) lpattern(dash)), xlabels(-1(1)1) ylabels(-0.6(0.2)0.6) xtitle("Perceived immorality I(j)") ytitle("Differences in willingness to work") plotregion(fcolor(white)) graphregion(fcolor(white)) legend(off)


*** Table F5

use "Data_WTW.dta", clear
** drop observation of people that did not fill out the survey (we do not have WTW for them)
drop if age==.
gen lowt_ij = factor1 * i_j_s1
ivreg2 WTW i_j_s1 factor1 lowt_ij if industry_ds==1, cluster(sessionsubject NOGA084)
ivreg2 WTW i_j_s1 factor1 lowt_ij i.major_cat female age swiss grosswage_rhrl revenue_per_employee tot_employ if industry_ds==1, cluster(sessionsubject NOGA084) partial(i.major_cat)
ivreg2 WTW i_j_s1 factor1 lowt_ij if industry_ds==0, cluster(sessionsubject description_comp)
ivreg2 WTW i_j_s1 factor1 lowt_ij i.major_cat female age swiss if industry_ds==0, cluster(sessionsubject description_comp) partial(i.major_cat)

*** Table F6
* Columns (1), (2), (5) and (6)
replace lowt_ij = factor1_rob1 * i_j_s1
ivreg2 WTW i_j_s1 factor1_rob1 lowt_ij if industry_ds==1, cluster(sessionsubject NOGA084)
ivreg2 WTW i_j_s1 factor1_rob1 lowt_ij i.major_cat female age swiss grosswage_rhrl revenue_per_employee tot_employ if industry_ds==1, cluster(sessionsubject NOGA084) partial(i.major_cat)
ivreg2 WTW i_j_s1 factor1_rob1 lowt_ij if industry_ds==0, cluster(sessionsubject description_comp)
ivreg2 WTW i_j_s1 factor1_rob1 lowt_ij i.major_cat female age swiss if industry_ds==0, cluster(sessionsubject description_comp) partial(i.major_cat)
* Columns (3), (4), (7) and (8)
replace lowt_ij = factor1_rob2 * i_j_s1
ivreg2 WTW i_j_s1 factor1_rob2 lowt_ij if industry_ds==1, cluster(sessionsubject NOGA084)
ivreg2 WTW i_j_s1 factor1_rob2 lowt_ij i.major_cat female age swiss grosswage_rhrl revenue_per_employee tot_employ if industry_ds==1, cluster(sessionsubject NOGA084) partial(i.major_cat)
ivreg2 WTW i_j_s1 factor1_rob2 lowt_ij if industry_ds==0, cluster(sessionsubject description_comp)
ivreg2 WTW i_j_s1 factor1_rob2 lowt_ij i.major_cat female age swiss if industry_ds==0, cluster(sessionsubject description_comp) partial(i.major_cat)


/************************************************************************
*
* Study 2
*
************************************************************************/

local path "$path_package/Study 2"

cd "`path'/"


use Data_Individual.dta, clear
tabu lying_aversion if nr_lies==0
tabu lying_aversion if nr_lies==1
tabu lying_aversion if nr_lies==2
tabu lying_aversion if nr_lies==3
tabu lying_aversion if nr_lies==4
tabu lying_aversion if nr_lies==5
tabu lying_aversion if nr_lies==.

table lying_aversion, c(mean expprofit_lying)

*** Table A7

use Data_Market_Microlevel.dta, clear

replace nr_lies=10 if nr_lies==.

* columns (1) to (6)
reg hired1 i.nr_lies if immoral, cluster(sessiongroup)
reg hired1 expprofit_lying if immoral, cluster(sessiongroup)
reg hired1 i.nr_lies if moral, cluster(sessiongroup)
reg hired1 expprofit_lying if moral, cluster(sessiongroup)
reg hired1 i.nr_lies if neutral, cluster(sessiongroup)
reg hired1 expprofit_lying if neutral, cluster(sessiongroup)

*** Figure A4

use Data_Market_Microlevel.dta, clear

collapse (mean) hired1, by(low_theta period treatment)

line hired1 period if low_theta & treatment==1, lpattern(shortdash) lwidth(thick) || line hired1 period if !low_theta & treatment==1, lwidth(thick) ||, legend(label(1 "Low-theta") label(2 "High-theta")) xlabel(1 3 6 9 12) ylabel(0(.1)1) ytitle("Employment rate") plotregion(fcolor(white)) graphregion(fcolor(white))

line hired1 period if low_theta & treatment==2, lpattern(shortdash) lwidth(thick) || line hired1 period if !low_theta & treatment==2, lwidth(thick) ||, legend(label(1 "Low-theta") label(2 "High-theta")) xlabel(1 3 6 9 12) ylabel(0(.1)1) ytitle("Employment rate") plotregion(fcolor(white)) graphregion(fcolor(white))

line hired1 period if low_theta & treatment==3, lpattern(shortdash) lwidth(thick) || line hired1 period if !low_theta & treatment==3, lwidth(thick) ||, legend(label(1 "Low-theta") label(2 "High-theta")) xlabel(1 3 6 9 12) ylabel(0(.1)1) ytitle("Employment rate") plotregion(fcolor(white)) graphregion(fcolor(white))


*** Figure A5

use Data_Market_Macrolevel.dta, clear

bysort treatment period: egen av_w = mean(equw)

line av_w period if treatment==1, c(ascending) lpattern(shortdash) lwidth(thick) || line av_w period if treatment==3, c(ascending) lwidth(thick) ||  line av_w period if treatment==2, c(ascending) lwidth(thick) lcolor(orange) lpattern(dash dot) || function y=0.5, range(1 12) lpattern(longdash) lwidth(thick) lcolor(dkgreen) ||, legend(label(1 "Immoral work") label(3 "Moral work") label(2 "Neutral work") label(4 "Equilibrium prediction")) ylabel(0(0.5)3.5) xlabel(1(1)12) ytitle("Average market wage (in CHF)") xtitle("Period") plotregion(fcolor(white)) graphregion(fcolor(white))

* tablenotes:
reg equw period if (immoral), cluster(sessiongr)
reg equw period if (moral), cluster(sessiongr)
reg equw period if (neutral), cluster(sessiongr)
reg equw period if (immoral) & period>7, cluster(sessiongr)
reg equw period if (moral) & period>7, cluster(sessiongr)
reg equw period if (neutral) & period>7, cluster(sessiongr)
use Data_Market_Microlevel.dta, clear
gen participate = 1 - not_participate
gen period_lowtheta = period*low_theta
probit participate low_theta period period_lowtheta if immoral, cluster(sessiongr)
truncreg wagerequest low_theta period period_lowtheta if immoral, ul(50) cluster(sessiongr)


** Table A8

use Data_Market_Microlevel.dta, clear
gen participate = 1 - not_participate

replace wagerequest=50 if wagerequest==.
replace wagerequest2=50 if wagerequest2==. 

gen immoral_low_theta = immoral * low_theta
gen moral_low_theta = moral * low_theta
gen neutral_low_theta = neutral * low_theta

* specifications (1) to (6)
probit participate low_theta moral neutral moral_low_theta neutral_low_theta i.gender age swiss chinese, cluster(sessiongr)
test low_theta + moral_low_theta==0
test low_theta + neutral_low_theta==0
test moral==neutral
test moral_low_theta== neutral_low_theta

truncreg wagerequest low_theta moral neutral moral_low_theta neutral_low_theta i.gender age swiss chinese, ul(50) cluster(sessiongr)
test low_theta + moral_low_theta==0
test low_theta + neutral_low_theta==0
test moral==neutral
test moral_low_theta== neutral_low_theta

reg hired1 low_theta moral neutral moral_low_theta neutral_low_theta i.gender age swiss chinese, cluster(sessiongroup)
test low_theta + moral_low_theta == 0
test low_theta + neutral_low_theta == 0
test moral==neutral
test neutral_low_theta == moral_low_theta

reg hired1 low_theta moral neutral moral_low_theta neutral_low_theta i.gender age swiss chinese i.sessiongroup, cluster(sessiongroup)
test low_theta + moral_low_theta == 0
test low_theta + neutral_low_theta == 0
test neutral_low_theta == moral_low_theta

reg hired_tot low_theta moral neutral moral_low_theta neutral_low_theta i.gender age swiss chinese, cluster(sessiongroup)
test low_theta + moral_low_theta == 0
test low_theta + neutral_low_theta == 0
test moral==neutral
test neutral_low_theta == moral_low_theta

reg hired_tot low_theta moral neutral moral_low_theta neutral_low_theta i.gender age swiss chinese i.sessiongroup, cluster(sessiongroup)
test low_theta + moral_low_theta == 0
test low_theta + neutral_low_theta == 0
test neutral_low_theta == moral_low_theta

** Table A9

use Data_Jobs.dta, clear

gen lnwage = ln(equw)
reg moral_action immoral if (moral | immoral), cluster(sessiongroup)
reg moral_action immoral lnwage if (moral | immoral), cluster(sessiongroup)

** Figure A6

use Data_Jobs.dta, clear

bysort treatment period: egen av_m = mean(moral_action)

line av_m period if treatment==1, c(ascending) lpattern(shortdash) lwidth(thick) || line av_m period if treatment==3, c(ascending) lwidth(thick) ||  line av_m period if treatment==2, c(ascending) lwidth(thick) lcolor(orange) lpattern(dash dot)||, legend(label(1 "Immoral work") label(3 "Moral work") label(2 "Neutral work")) ylabel(0(0.1)0.5) xlabel(1(1)12) ytitle("Share costly (moral) action") xtitle("Period") plotregion(fcolor(white)) graphregion(fcolor(white))


** Figure A7

use Data_Jobs.dta, clear
drop if neutral
collapse (mean) moral_action low_theta immoral sessiongroup, by(sessionsubject)
tempfile temp
save `temp', replace
preserve
keep if immoral
replace immoral = 2
expand 14 if sessionsubject==301
append using `temp'
save `temp', replace
restore
keep if immoral
replace immoral = 3
expand 14 if sessionsubject==304
append using `temp'
cumul moral_action if immoral==0, gen(cum0)
cumul moral_action if immoral==1, gen(cum1)
cumul moral_action if immoral==2, gen(cum2)
cumul moral_action if immoral==3, gen(cum3)
sort cum0 cum1 cum2 cum3
line cum0 moral_action if immoral==0, lwidth(thick) lcolor(orange) || line cum1 moral_action if immoral==1, lpattern(dash dot) lpattern(shortdash) lwidth(thick) lcolor(navy) || line cum2 moral_action if immoral==2, lpattern(dash dot) lwidth(thick) lcolor(ebblue) || line cum3 moral_action if immoral==3, lpattern(longdash) lwidth(thick) lcolor(eltblue) ||, legend(label(1 "Moral") label(2 "Immoral") label(3 "Immoral, min moral action") label(4 "Immoral, max moral action")) ytitle("CDF") xtitle("Share moral action when hired for G job") plotregion(fcolor(white)) graphregion(fcolor(white))


* Footnote 1
use Data_Jobs.dta, clear
xtile q10_equw = equw, nq(10)
reg moral_action immoral i.q10_equw if (moral | immoral), cluster(sessiongroup)
gen wage_low = equw<.69
reg moral_action immoral wage_low if (moral | immoral), cluster(sessiongroup)


/************************************************************************
*
* SLFS
*
************************************************************************/

/*

** The following parts require SLFS individual level data, see Other data/README.txt for information

use "$path_individual_data/SAKE2010-16_final.dta", clear 
gen ln_grosswage_rhrl = ln(grosswage_rhrl)
tabulate year, generate(dyear)
tabulate EM06, generate(dEM06)
drop dyear1 dEM061
replace tot_employ=tot_employ/1000

egen std_i_j_s1 = std(i_j_s1)
egen std_i_j_s2 = std(i_j_s2)
egen std_i_j_s3 = std(i_j_s3)

* specifications (1) to (3)
reg ln_grosswage_rhrl std_i_j_s1 age male married eduhigh edumiddle swiss tenure fte boardmember revenue_per_employee tot_employ dyear* dEM06* [aweight=weight_cross] if i_j_s1!=., cluster(noga20084)
nlcom (exp(_b[std_i_j_s1])-1)
reg ln_grosswage_rhrl std_i_j_s2 age male married eduhigh edumiddle swiss tenure fte boardmember revenue_per_employee tot_employ dyear* dEM06* [aweight=weight_cross] if i_j_s2!=., cluster(noga20084)
nlcom (exp(_b[std_i_j_s2])-1)
reg ln_grosswage_rhrl std_i_j_s3 age male married eduhigh edumiddle swiss tenure fte boardmember revenue_per_employee tot_employ dyear* dEM06* [aweight=weight_cross] if i_j_s3!=., cluster(noga20084)
nlcom (exp(_b[std_i_j_s3])-1)

*** fn 4, fn8, fn10
bysort noga20084: egen tot_obs = count(noga20084)
replace tot_obs = 1/tot_obs
reg ln_grosswage_rhrl std_i_j_s1 [pweight=tot_obs], cluster(noga20084)
reg ln_grosswage_rhrl std_i_j_s1 age male married eduhigh edumiddle swiss tenure fte boardmember revenue_per_employee tot_employ [pweight=tot_obs], cluster(noga20084)
reg ln_grosswage_rhrl std_i_j_s1 age male married eduhigh edumiddle swiss tenure fte boardmember revenue_per_employee tot_employ dyear* dEM06* [pweight=tot_obs], cluster(noga20084)

reg ln_grosswage_rhrl std_i_j_s2 [pweight=tot_obs], cluster(noga20084)
reg ln_grosswage_rhrl std_i_j_s2 age male married eduhigh edumiddle swiss tenure fte boardmember revenue_per_employee tot_employ [pweight=tot_obs], cluster(noga20084)
reg ln_grosswage_rhrl std_i_j_s2 age male married eduhigh edumiddle swiss tenure fte boardmember revenue_per_employee tot_employ dyear* dEM06* [pweight=tot_obs], cluster(noga20084)

reg ln_grosswage_rhrl std_i_j_s3 [pweight=tot_obs], cluster(noga20084)
reg ln_grosswage_rhrl std_i_j_s3 age male married eduhigh edumiddle swiss tenure fte boardmember revenue_per_employee tot_employ [pweight=tot_obs], cluster(noga20084)
reg ln_grosswage_rhrl std_i_j_s3 age male married eduhigh edumiddle swiss tenure fte boardmember revenue_per_employee tot_employ dyear* dEM06* [pweight=tot_obs], cluster(noga20084)

*** Table B2
reg ln_grosswage_rhrl std_i_j_s1 [aweight=weight_cross], cluster(noga20084)
reg ln_grosswage_rhrl std_i_j_s1  age male married eduhigh edumiddle swiss tenure fte boardmember revenue_per_employee tot_employ [aweight=weight_cross], cluster(noga20084)
reg ln_grosswage_rhrl std_i_j_s1 age male married eduhigh edumiddle swiss tenure fte boardmember revenue_per_employee tot_employ dyear* dEM06* [aweight=weight_cross], cluster(noga20084)		

*** Table B4
reg ln_grosswage_rhrl std_i_j_s2 [aweight=weight_cross], cluster(noga20084)
reg ln_grosswage_rhrl std_i_j_s2  age male married eduhigh edumiddle swiss tenure fte boardmember revenue_per_employee tot_employ [aweight=weight_cross], cluster(noga20084)
reg ln_grosswage_rhrl std_i_j_s2 age male married eduhigh edumiddle swiss tenure fte boardmember revenue_per_employee tot_employ dyear* dEM06* [aweight=weight_cross], cluster(noga20084)	
reg ln_grosswage_rhrl std_i_j_s3 [aweight=weight_cross], cluster(noga20084)
reg ln_grosswage_rhrl std_i_j_s3  age male married eduhigh edumiddle swiss tenure fte boardmember revenue_per_employee tot_employ [aweight=weight_cross], cluster(noga20084)
reg ln_grosswage_rhrl std_i_j_s3 age male married eduhigh edumiddle swiss tenure fte boardmember revenue_per_employee tot_employ dyear* dEM06* [aweight=weight_cross], cluster(noga20084)	


*** Table B6
gen tobacco_manu = (noga20084==1200) 
gen tobacco_whole = (noga20084==4635) 
gen weapons = (noga20084== 2540) 
gen gambling = (noga20084==9200)
gen banking = (noga20084==6419)
gen credit = (noga20084== 6492)
reg ln_grosswage_rhrl weapons tobacco_manu tobacco_whole gambling [aweight=weight_cross], cluster(noga20084)
reg ln_grosswage_rhrl weapons tobacco_manu tobacco_whole gambling age male married eduhigh edumiddle swiss tenure fte boardmember revenue_per_employee tot_employ [aweight=weight_cross], cluster(noga20084)
reg ln_grosswage_rhrl weapons tobacco_manu tobacco_whole gambling age male married eduhigh edumiddle swiss tenure fte boardmember revenue_per_employee tot_employ dyear* dEM06* [aweight=weight_cross], cluster(noga20084)	
* footnote 12
reg ln_grosswage_rhrl weapons tobacco_manu tobacco_whole gambling banking credit age male married eduhigh edumiddle swiss tenure fte boardmember revenue_per_employee tot_employ dyear* dEM06* [aweight=weight_cross], cluster(noga20084)	


*/


*** Table B1

insheet using "$path_package/Other data/Perception_data/Sample1/I_j.csv", clear
tabu i_j_s1
* Decription: noga20084: 1200 = "Tobacco (manuf.)" 1083 = "Tea and coffee" 1712 = "Paper (manuf.)" 2540 = "Weapons (manuf.)" 2611 = "Electronic (manuf.)" 4635 = "Tobacco (wholes.)" 4645 = "Perfumes (wholes.)" 4648 = "Watches and jewelry" 4642 = "Clothing and footwear" 6492 = "Credit granting" 6512 = "Non-life insur." 9200 = "Gambling and betting" 9311 = "Sports facilities" 9313 = "Fitness facilities" 4120 = "Construction" 4520 = "Maintenance vehicles" 5510 = "Hotels and accommodation" 5610 = "Restaurant activities" 6419 = "Monetary intermediations" 8411 = "Public administration"

*** Table B3

insheet using "$path_package/Other data/Perception_data/Sample2/I_j.csv", clear
tabu i_j_s2
insheet using "$path_package/Other data/Perception_data/Sample3/I_j.csv", clear
tabu i_j_s3

*** Table B5

use "$path_package/Other data/Perception_data/Sample3/cleaned_data.dta", clear
gen german = userlanguage=="DE"
sum age female german
tabu income

